package com.scproject.scbef.controller.user;

import com.scproject.annotations.PassToken;
import com.scproject.dto.ResponseDto;
import com.scproject.scbef.pojo.User;
import com.scproject.scbef.pojo.vo.UserLogin;
import com.scproject.scbef.service.user.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartHttpServletRequest;

/**
 * @author LNL
 * @date 2021/5/19 14:17
 */
@RestController
@Api(tags = "用户模块")
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/login")
    @ApiOperation("通过学号登录")
    @PassToken
    public ResponseDto login(@RequestBody UserLogin userLogin) {
        ResponseDto responseDto = userService.login(userLogin);
        return responseDto;
    }

    @PostMapping("/register")
    @ApiOperation("注册")
    @PassToken
    public ResponseDto register(MultipartHttpServletRequest request) {
        ResponseDto responseDto = userService.register(request);
        return responseDto;
    }

    //修改用户信息

    //删除用户信息



}
